const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  // await page.goto('https://pdai.tech/', {
  await page.on('load', () => console.log('Page loaded!'));
  await page.goto('file:///Users/caoshichao/Library/Containers/com.tencent.xinWeChat/Data/Library/Application%20Support/com.tencent.xinWeChat/2.0b4.0.9/9163dc076a44955c4a2f34444bd336a6/Message/MessageTemp/647d889d7bc0e40b33c2ea3f54b36320/File/wedding%202/wedding.html?token=52_LKKUgSKanqhsmtDGtjUqrL6TDfFF0QmbZ07HVQTFEn4UXZ-ncfTV3VWBoEIPov4zjnoXcaBGPyi4gdiCcxaOxqENc2ROAE-bm5ZaTZvG-243shYF8RAd8bFTp66xOg2fOD5POxDjqnxPmmDcQOBjAAAFDQ', {
    waitUntil: 'networkidle2',
  });
  await page.waitFor(10000);
  await page.pdf({ path: 'hn.pdf' });

  await browser.close();
})();